<div class="eject_con">
    <link rel="stylesheet" type="text/css" href="<?php echo RESOURCE_SITE_URL;?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"  />
  <div id="warning" class="alert alert-error"></div>
  <form method="post" target="_parent" action="index.php?act=store_brand&op=brand_home_save"enctype="multipart/form-data" id="brand_apply_form">
    <input type="hidden" name="form_submit" value="ok" />
    <input type="hidden" name="brand_id" value="<?php echo $output['brand_array']['brand_id']; ?>" />
    <dl>
      <dt><i class="required">*</i><?php echo $lang['store_goods_brand_name'].$lang['nc_colon'];?></dt>
      <dd>
        <input type="text" class="text" name="brand_title" value="<?php echo $output['brand_array']['brand_name']; ?>" id="brand_name" />
      </dd>
    </dl>
    <dl>
      <dt><i class="required">*</i><?php echo $lang['store_goods_brand_icon'].$lang['nc_colon'];?></dt>
      <dd>
        <div style="display:none;"><span class="sign"><img src="<?php echo brandImage($output['brand_array']['brand_logo']);?>" onload="javascript:DrawImage(this,70,70)" nc_type="logo1"/></span></div>
        <div class="ncsc-upload-btn"> <a href="javascript:void(0);"><span>
          <input type="file" hidefocus="true" size="1" class="input-file" name="brand_logo" id="brand_pic" nc_type="logo"/>
          </span>
          <p><i class="icon-upload-alt"></i>图片上传</p>
          </a> </div>
        <p class="hint">建议上传大小为70x70的图片</p>
      </dd>
    </dl>
    <dl>
          <dt><i class="required">*</i>首页推广图片<?php echo $lang['nc_colon'];?></dt>
          <dd>
              <div style="display:none;"><span class="sign"><img src="<?php echo brandImage($output['brand_array']['brand_image']);?>" onload="javascript:DrawImage(this,292,115)" nc_type="logo1"/></span></div>
              <div class="ncsc-upload-btn"> <a href="javascript:void(0);"><span>
                <input type="file" hidefocus="true" size="1" class="input-file" name="brand_image" id="brand_image" nc_type="logo"/>
              </span>
                      <p><i class="icon-upload-alt"></i>图片上传</p>
                  </a> </div>
              <p class="hint">建议上传大小为585x230的图片</p>
          </dd>
    </dl>
    <dl>
          <dt><i class="required">*</i>推广提示<?php echo $lang['nc_colon'];?></dt>
          <dd>
              <input type="text" class="text" name="brand_tip" value="<?php echo $output['brand_array']['brand_tip']; ?>" id="brand_tip" size="45" />
              <p class="hint">折扣部分请用&lt;em&gt;&lt;/em&gt;标签</p>
          </dd>
    </dl>
      <dl>
          <dt><i class="required">*</i>开始时间<?php echo $lang['nc_colon'];?></dt>
          <dd>
              <input type="text" id="start_time" name="start_date" class="input-txt" />
          </dd>
      </dl>
      <dl>
          <dt><i class="required">*</i>结束时间<?php echo $lang['nc_colon'];?></dt>
          <dd>
              <input type="text" id="end_time" name="end_date" class="input-txt" />
          </dd>
      </dl>
    <div class="bottom">
      <label class="submit-border"><input type="submit" class="submit" value="<?php echo $lang['nc_submit'];?>"/></label>
    </div>
  </form>
</div>
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/common.js" charset="utf-8"></script>
<script src="<?php echo RESOURCE_SITE_URL;?>/js/jquery-ui/i18n/zh-CN.js"></script>
<script src="<?php echo RESOURCE_SITE_URL;?>/js/jquery-ui-timepicker-addon/jquery-ui-timepicker-addon.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo RESOURCE_SITE_URL;?>/js/jquery-ui-timepicker-addon/jquery-ui-timepicker-addon.min.css"  />
<script>
$(function(){
    $('#start_time').datetimepicker({
        controlType: 'select'
    });
    $('#end_time').datetimepicker({
        controlType: 'select'
    });
    jQuery.validator.addMethod("initial", function(value, element) {
        return /^[A-Za-z0-9]$/i.test(value);
    }, "");
    $('#brand_apply_form').validate({
        errorLabelContainer: $('#warning'),
        invalidHandler: function(form, validator) {
               $('#warning').show();
        },
    	submitHandler:function(form){
    		ajaxpost('brand_apply_form', '', '', 'onerror') 
    	},
        rules : {
            brand_name : {
                required : true,
                rangelength: [0,100]
            },
            brand_initial : {
                initial  : true
            }
			<?php if ($output['brand_array']['brand_id']=='') { ?>
			,
            brand_pic : {
                required : true
			}
			<?php } ?>		
        },
        messages : {
            brand_name : {
                required : '<i class="icon-exclamation-sign"></i><?php echo $lang['store_goods_brand_input_name'];?>',
                rangelength: '<i class="icon-exclamation-sign"></i><?php echo $lang['store_goods_brand_name_error'];?>'
            },
            brand_initial : {
                initial : '<i class="icon-exclamation-sign"></i>请填写正确首字母'
            }
			<?php if ($output['brand_array']['brand_id']=='') { ?>
			,
            brand_pic : {
                required : '<i class="icon-exclamation-sign"></i><?php echo $lang['store_goods_brand_icon_null'];?>'
			}
			<?php } ?>
        }
    });
	$('input[nc_type="logo"]').change(function(){
		var src = getFullPath($(this)[0]);
		$('img[nc_type="logo1"]').attr('src', src);
	});
});

</script> 
